/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.system.service;

import java.util.List;

import com.thinkgem.jeesite.modules.sys.entity.Office;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.system.entity.VivoDingConf;
import com.vivo.system.dao.VivoDingConfDao;

/**
 * 钉钉接入管理Service
 * @author jyangye
 * @version 2018-05-11
 */
@Service
@Transactional(readOnly = true)
public class VivoDingConfService extends CrudService<VivoDingConfDao, VivoDingConf> {

    @Autowired
    private VivoDingConfDao vivoDingConfDao;

	public VivoDingConf get(String id) {
		return super.get(id);
	}
	
	public List<VivoDingConf> findList(VivoDingConf vivoDingConf) {
		return super.findList(vivoDingConf);
	}
	
	public Page<VivoDingConf> findPage(Page<VivoDingConf> page, VivoDingConf vivoDingConf) {
		return super.findPage(page, vivoDingConf);
	}

	public VivoDingConf getByComp(String compId) {
	    VivoDingConf query = new VivoDingConf();
        Office comp = new Office();
        comp.setId(compId);
        query.setComp(comp);
        List<VivoDingConf> confList = vivoDingConfDao.getByComp(query);
        return confList.size() > 0 ? confList.get(0) : null;
    }
	
	@Transactional(readOnly = false)
	public void save(VivoDingConf vivoDingConf) {
		super.save(vivoDingConf);
	}
	
	@Transactional(readOnly = false)
	public void delete(VivoDingConf vivoDingConf) {
		super.delete(vivoDingConf);
	}
	
}